package com.huaxin.common.Entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Administrator on 2016/11/23.
 * {"deviceCode":"5","deviceName":"hx-300","deviceType":"常规活性污泥法",
 * "readCycle":"2323","sendCycle":"4442","snCode":"4444","checkState":1}
 *
 * {"deviceCode":"9","deviceName":"风机"},{"deviceCode":"8","deviceName":"泵机"},
 * {"deviceCode":"7","deviceName":"hx-200","deviceState":0,"deviceType":"常规A/O",
 * "imgUrl":"20161102143012_fsdfdsf.jpg","readCycle":"7777","sendCycle":"8893","snCode":"4343"},
 * {"deviceCode":"20161130142823","deviceName":"子设备"},
 * {"deviceCode":"20161130133537","deviceName":"测试设备","deviceType":"常规活性污泥法",
 * "imgUrl":"20161130154721_图片2.jpg"},{"deviceCode":"16","deviceName":"泵机"}
 */

public class Device implements Parcelable {


    /**
     * deviceCode : 20170623190610
     * deviceName : 测试设施1
     * deviceType : 常规活性污泥法
     * imgUrl : http://139.224.234.222:8082/uploads/deviceinfo/170625044604_89_398_1498380363000.png
     * lat : 30.509329
     * lng : 114.431657
     * readCycle : 1
     * sendCycle : 1
     * snCode : 123435
     * state : 0
     */

    private String deviceCode;
    private String deviceName;
    private String deviceType;
    private String imgUrl;
    private double lat;
    private double lng;
    private String readCycle;
    private String sendCycle;
    private String snCode;
    private int    state;

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public String getReadCycle() {
        return readCycle;
    }

    public void setReadCycle(String readCycle) {
        this.readCycle = readCycle;
    }

    public String getSendCycle() {
        return sendCycle;
    }

    public void setSendCycle(String sendCycle) {
        this.sendCycle = sendCycle;
    }

    public String getSnCode() {
        return snCode;
    }

    public void setSnCode(String snCode) {
        this.snCode = snCode;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.deviceCode);
        dest.writeString(this.deviceName);
        dest.writeString(this.deviceType);
        dest.writeString(this.imgUrl);
        dest.writeDouble(this.lat);
        dest.writeDouble(this.lng);
        dest.writeString(this.readCycle);
        dest.writeString(this.sendCycle);
        dest.writeString(this.snCode);
        dest.writeInt(this.state);
    }

    public Device() {
    }

    protected Device(Parcel in) {
        this.deviceCode = in.readString();
        this.deviceName = in.readString();
        this.deviceType = in.readString();
        this.imgUrl = in.readString();
        this.lat = in.readDouble();
        this.lng = in.readDouble();
        this.readCycle = in.readString();
        this.sendCycle = in.readString();
        this.snCode = in.readString();
        this.state = in.readInt();
    }

    public static final Creator<Device> CREATOR = new Creator<Device>() {
        @Override
        public Device createFromParcel(Parcel source) {
            return new Device(source);
        }

        @Override
        public Device[] newArray(int size) {
            return new Device[size];
        }
    };
}
